package org.osami.commons.smarthome.settopbox.impl;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import org.osami.commons.hid.IHidProvider;
import org.osami.commons.smarthome.settopbox.ISetTopBoxComponent;

public class Activator implements BundleActivator {
	
	private static BundleContext bundleContext = null;
	SetTopBoxComponent component;
	HidProvider hid;
	
	SetTopBoxComponent getComponent() {
		return component;
	}
	
	HidProvider getHidComponent() {
		return hid;
	}
	
	public static BundleContext getBundleContext() {
		return bundleContext;
	}
	
	public void start(BundleContext context) throws Exception {
		System.out.println("SetTopBox component starting");
		component = new SetTopBoxComponent();
		hid = new HidProvider();
		context.registerService(ISetTopBoxComponent.class.getName(), getComponent(), null);
		System.out.println("SetTopBox component registered");
		context.registerService(IHidProvider.class.getName(), getHidComponent(), null);
		System.out.println("IHidProvider component registered");
	}
	
	
	public void stop(BundleContext context) throws Exception {
		System.out.println("SetTopBox component closing");
	}

}
